/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package za.ac.cput.pretorius.question3.srpViolation.service.impl;

import java.math.BigDecimal;
import za.ac.cput.pretorius.question3.srpViolation.service.CalculateAndConvertService;

/**
 *
 * @author griddy
 */
public class CalculateAndConvertServiceImpl implements CalculateAndConvertService {

    @Override
    public String convertRandToDollarAndPrint(BigDecimal rand) {
         return rand.multiply(BigDecimal.valueOf(9.5)).toString();
    
    }

    @Override
    public String covertRandToPoundAndPrint(BigDecimal rand) {
         return rand.multiply(BigDecimal.valueOf(12)).toString();
    }

    @Override
    public BigDecimal add(BigDecimal one, BigDecimal two) {
        return one.add(two);
    }

    @Override
    public BigDecimal devide(BigDecimal one, BigDecimal two) {
        if(two.equals(BigDecimal.valueOf(0)))
            return null;
        else
            return one.divide(two);
    }

    @Override
    public BigDecimal multiply(BigDecimal one, BigDecimal two) {
        return one.multiply(two);
    }

    @Override
    public BigDecimal subtract(BigDecimal one, BigDecimal two) {
        return one.subtract(two);
    }
    
}
